package common;

import com.alibaba.fastjson2.JSONObject;

public class User{
    public String username;
    public String sign;
    public boolean allowStrangerChat;

    public User(){
        username = "undefined";
        sign = "undefined";
        allowStrangerChat = false;
    }

    public User(JSONObject jsonObject){
        this.username = jsonObject.getString("username");
        this.sign = jsonObject.getString("sign");
        this.allowStrangerChat = jsonObject.getBoolean("allowStrangerChat")==null?
                false:jsonObject.getBoolean("allowStrangerChat");
    }
}
